//
//  ActivityStore.m
//  NewPro
//
//  Created by RYX on 2019/4/28.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "ActivityStore.h"
#import "ActionModel.h"

@implementation ActivityStore

- (void)getActivityListWithCustid:(NSString *)custid Success:(void(^)(NSArray *listArr))success Failure:(void(^)(NSError *error))failure{
    
    NSString *url = [NSString stringWithFormat:@"%@/api/activity/activityList",IP];
    NSDictionary *dic = @{
                          @"custid":custid
                          };
    [HttpTool postUrlWithString:url parameters:dic success:^(id responseObject) {
        
        NSError *error = [HttpTool inspectError:responseObject];
        if (error == nil) {
            
            NSArray *listArr = [ActionModel mj_objectArrayWithKeyValuesArray:responseObject[@"data"][@"items"]];
            success(listArr);
        }else{
            
            failure(error);
        }
        
    } failure:^(NSError *error) {
        
        failure(error);
    }];
}
@end
